package com.mzy.olddate.demo;

/**
 * @author Ives
 * * @date 2021/9/2
 */
public class Demo2 {
  public static void main(String[] args) {
    String words = "hello java,hello php";
    System.out.println("原始字符串是'"+words+"'");
    System.out.println("replace(\"l\",\"D\")结果："+words.replace("l","D"));
    System.out.println("replace(\"hello\",\"你好\")结果："+words.replace("hello","你好 "));


    String str = "update CMS_DRAFT_COLUMN_INFO_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_COLUMN_INFO_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_DRAFT_COL_GROUP_PERM_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_DRAFT_NEWS_BASE_INFO_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_NEWS_BASE_INFO_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_DRAFT_NEWS_CONTENT_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_NEWS_CONTENT_5G set COL_CODE='XXYY' where COL_CODE='AABB';\n" +
            "update CMS_PAGE_COLUMN_SIGN_5G set COLUMN_CODE='XXYY' where COLUMN_CODE='AABB';\n";

    String replace = str.replaceAll("XXYY", "020020");
    System.out.println(replace);


  }
}
